package cs275.ants.graph.base;

import java.io.Serializable;

import org.lwjgl.util.Point;

import com.google.common.base.Objects;

public class GraphVertex implements Serializable {
	private static final long serialVersionUID = 3L;
	private Point coordinates;
	
	public GraphVertex(int row, int col) {
		this.coordinates = new Point(col, row);
	}
	
	public int getRow() {
		return coordinates.getY();
	}

	public int getCol() {
		return coordinates.getX();
	}
	
	public Point getCoordinates() {
		return coordinates;
	}

	@Override
	public String toString() {
		return Objects.toStringHelper(this)
				.add("coordinates", coordinates)
				.toString();
	}
	
	@Override
	public boolean equals(Object obj) {
		if(!(obj instanceof GraphVertex)) {
			return false;
		}
		
		GraphVertex other = (GraphVertex) obj; 
		return Objects.equal(coordinates, other.getCoordinates());
	}
	
	@Override
	public int hashCode() {
		return Objects.hashCode(coordinates);
	}
}